package org.jeecg.modules.nation.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.nation.entity.Nation;
import org.jeecg.modules.nation.mapper.NationMapper;
import org.jeecg.modules.nation.service.NationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  民族
 * </p>
 *
 * @author liujiamiao
 * @email 2544296058@qq.com
 * @since 2020-10-21
 */
@Service
public class NationServiceImpl extends ServiceImpl<NationMapper, Nation> implements NationService {

    @Override
    public Integer getIdByName(String name) {
        Nation nation = baseMapper.selectOne(new QueryWrapper<Nation>().eq("nation_name", name).select("nation_id"));
        return nation.getNationId();
    }
}
